<html>
 <head>
  <link href="./leetcode-problem.css" rel="stylesheet" type="text/css">
 </head>
 <body>
  <div class="question_difficulty">
   难度：Medium
  </div>
  <div>
   <h1 class="question_title">
    713. Subarray Product Less Than K
   </h1>
   <p>
    Your are given an array of positive integers
    <code>
     nums
    </code>
    .
   </p>
   <p>
    Count and print the number of (contiguous) subarrays where the product of all the elements in the subarray is less than
    <code>
     k
    </code>
    .
   </p>
   <p>
    <b>
     Example 1:
    </b>
    <br>
   </p>
   <pre>
<b>Input:</b> nums = [10, 5, 2, 6], k = 100
<b>Output:</b> 8
<b>Explanation:</b> The 8 subarrays that have product less than 100 are: [10], [5], [2], [6], [10, 5], [5, 2], [2, 6], [5, 2, 6].
Note that [10, 5, 2] is not included as the product of 100 is not strictly less than k.
</pre>
   <p>
    <b>
     Note:
    </b>
   </p>
   <li>
    <code>
     0 &lt; nums.length &lt;= 50000
    </code>
    .
   </li>
   <li>
    <code>
     0 &lt; nums[i] &lt; 1000
    </code>
    .
   </li>
   <li>
    <code>
     0 &lt;= k &lt; 10^6
    </code>
    .
   </li>
  </div>
  <div>
   <h1 class="question_title">
    713. 乘积小于K的子数组
   </h1>
   <p>
    给定一个正整数数组&nbsp;
    <code>
     nums
    </code>
    。
   </p>
   <p>
    找出该数组内乘积小于&nbsp;
    <code>
     k
    </code>
    &nbsp;的连续的子数组的个数。
   </p>
   <p>
    <strong>
     示例 1:
    </strong>
   </p>
   <pre>
<strong>输入:</strong> nums = [10,5,2,6], k = 100
<strong>输出:</strong> 8
<strong>解释:</strong> 8个乘积小于100的子数组分别为: [10], [5], [2], [6], [10,5], [5,2], [2,6], [5,2,6]。
需要注意的是 [10,5,2] 并不是乘积小于100的子数组。
</pre>
   <p>
    <strong>
     说明:
    </strong>
   </p>
   <ul>
    <li>
     <code>
      0 &lt; nums.length &lt;= 50000
     </code>
    </li>
    <li>
     <code>
      0 &lt; nums[i] &lt; 1000
     </code>
    </li>
    <li>
     <code>
      0 &lt;= k &lt; 10^6
     </code>
    </li>
   </ul>
  </div>
 </body>
</html>